×
☰ See All Chapters

Spring Data JPA Tutorial

This spring data JPA tutorial describes how spring has improved plain JPA to reduce boilerplate code. Spring data JPA is an abstraction over JPA. Means spring data JPA internally uses JPA. JPA is an abstraction over JDBC. Means JPA internally uses JDBC.  Spring Data JPA adds its own features like a no-code implementation of the repository pattern and the creation of database queries from method names.  If application has any other spring feature, it will be easy to with integrate spring data JPA than with plain JPA.

Why Spring Data JPA?

While developing an application, one should concentrate on writing application specific code instead of writing, repetitive and complex data access layer code. Developer should not spend more time in writing repetitive code that shows up again and again in order to get some result that seems like it ought to be much simpler.

                                                                       spring-data-jpa-tutorial-0
 

How Spring Data JPA reduced the complexity of JPA?

Spring Data JPA repository abstraction reduced significant amount of boilerplate code required to implement data access layers for various persistence stores. Below picture shows how spring data JPA has reduced the complexity from plain JPA.

spring-data-jpa-tutorial-1
 

All Chapters
Author